#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/08/14
# @Author   :Changshu
# @File     :practice_58.py
# 58. 最后一个单词的长度

def lengthOfLastWord(s:str)->int:
	sList=s.rstrip().split(' ')
	if len(sList)==0:
		return 0
	return len(sList[-1].rstrip())

if __name__ == '__main__':
	s='Hello World'
	# s='a '
	print(lengthOfLastWord(s))